<template>
    <div>
        <span v-for="(result, index) in results" :key="index" :class="getClass(result)">
            {{ index + 1 }}: {{ result }}
        </span>
    </div>
</template>

<script>
export default {
    props: {
        results: Array
    },
    methods: {
        getClass(result) {
            if (result === "回答正确") return "right";
            if (result === "回答错误") return "error";
            return "undo";
        }
    }
};
</script>

<style scoped>
.right {
    color: green;
}

.error {
    color: red;
}

.undo {
    color: #ccc;
}
</style>